#if 0
#include <stdio.h>

#include "wifi.h"
#include "network.h"
#include "error_check.h"

void app_main(void)
{
    wifi_connect_config("yanu", "5201314ygyu", NULL);
#if 0
    // tcp 客户端测试
    int port = 8000;
    char ip[] = "192.168.22.56";

    int tcpSock =  TCP_Init(ip, &port, TCPCLIMODE);
    int i = 0;
    char bufData[128] = "";
    char buf[] = ":张鑫是个小可爱";

    //error_check_start();

    while(i++ < 100){
        char bufi[4] = "";
        sprintf(bufi, "%d", i);
        strcat(bufData, bufi);
        strcat(bufData, buf);

        if(send(tcpSock, bufData, strlen(bufData)+1, 0) < 0){
            printf("send failed\n");
        }
         memset(bufData, 0, sizeof(bufData));
        vTaskDelay(3000 / portTICK_PERIOD_MS);
    }
#else
    // tcp服务端测试
    int port = 8000;

    int tcpSock =  TCP_Init(NULL, &port, TCPSERMODE);
    char bufData[128] = "";

    int cliSock = accept(tcpSock, NULL, NULL);

    while(1){
        int err = recv(cliSock, bufData, sizeof(bufData)-1, 0);
        if(err < 0){
            ESP_LOGI("recv", "failed, err:%d", err);
        }
        printf("recv:%s\n", bufData);
        vTaskDelay(5000 / portTICK_PERIOD_MS);
    }
#endif
}
#endif
